Skip to content

feat(ai-tools): skills improvements + contributor skill tooling#3369

Open
dreamwasp wants to merge 11 commits into
mainfrom
cass-gmt-skills-3777
Open

feat(ai-tools): skills improvements + contributor skill tooling#3369
dreamwasp wants to merge 11 commits into
mainfrom
cass-gmt-skills-3777

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Expands the Gamut agent-tools skill set, audits and improves all existing skills, adds a contributor-only skills infrastructure, and improves the DESIGN.md generation tooling.

New skills

  • gamut-datatable — full skill for DataTable: when to use, props, ColumnConfig, useLocalQuery, row action menus with PopoverContainer, empty/loading states, color mode, and container queries
  • gamut-datalist — full skill for DataList: same coverage plus variant (default/card), expandable rows (expandedContent / onRowExpand), row selection (onRowSelect / hideSelectAll), and combined expansion + selection patterns

Updated skills

  • gamut-list — added DataTable/DataList cross-references and a "reach for a higher-level component first" callout at the top of "When to use List"
  • gamut-buttons — moved "Focus management — buttons with ToolTip" to TOOLTIP_FOCUS.md (progressive disclosure); inline section replaced with a 3-line context pointer
  • gamut-layout — expanded frontmatter description to surface the skill for media-query / responsive-layout queries, useWindowSize / useBreakpoint hooks, and mobile-first patterns
  • gamut-review — three new checks:
    • Check 3b: SCSS/CSS module imports and className on Gamut components
    • Check 3c: nested selectors (tag selectors and ${GamutComponent} child selectors)
    • Check 4 Step 2: non-Gamut CSS custom properties (var(--darkNeutralColor) etc.)
    • Plus: @codecademy/gamut-kit package recognition, StyleProps + states()/variant() validation, jest.mock(GamutProvider) warning, expanded remediation skill links

Skill quality audit (applied writing-great-skills framework across all skills)

  • All descriptions now start with "Use this skill when" and list concrete trigger branches — gamut-forms, gamut-accessibility, gamut-review, gamut-layout, gamut-typography, gamut-system-props
  • Removed ## Key principles sediment from gamut-theming, gamut-style-utilities, gamut-system-props
  • Fixed broken relative paths → Storybook URLs in gamut-style-utilities and gamut-system-props
  • gamut-color-mode: merged duplicate decision guides; replaced exhaustive semantic alias token tables (~60 lines) with a Storybook pointer; removed Core hex illustration section (duplicates gamut-review Appendix B)
  • gamut-datatable: replaced duplicate emptyMessage JSX example with a pointer to gamut-datalist
  • gamut-testing: removed double --- formatting artifact

Contributor tooling

  • New local-skills/ directory — canonical source for contributor-only skills, never exported via gamut plugin install
  • scripts/sync-local-skills.mjs — syncs local-skills/.claude/skills/ (Claude Code) and .cursor/rules/ (Cursor); --check mode for CI; auto-cleans orphaned generated files when a skill is removed
  • Pre-commit hook runs sync automatically and stages generated files; yarn sync-skills / yarn sync-skills:watch for manual and dev use
  • gamut-create-skill moved from exported skills to local-skills/ — contributor-only blueprint playbook, now includes a /writing-great-skills review step in the consistency checklist
  • Best practices.mdx: "Agent skills" section split into "Exported skills" and "Contributor-only skills" subsections

design.mjs tooling

  • installDesignMd now stamps a <!-- Generated by @codecademy/gamut@{version} … --> header at the top of DESIGN.md instead of a plain copyFile — includes the re-run command so the file is self-documenting
  • New test file bin/__tests__/design.test.mjs (Node built-in test runner, no Jest dependency) covers: version stamp, theme alias in comment, --force guard, fallback to "unknown" when package.json is absent, source file unchanged
  • test:bin npm script + test-bin NX task wired as a dependency of the main test target

PR Checklist

  • Related to designs: N/A — skill/tooling PR
  • Related to JIRA ticket: [GMT-3777]
  • Version plan added/updated (minor bump — .nx/version-plans/version-plan-1780940298971.md)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change (bin/__tests__/design.test.mjs)
  • This PR includes testing instructions for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Go to Organisms / Lists & Tables / DataTable in Storybook — verify the new Column size="content" story renders and shows misaligned header/data widths as expected
  2. Do the same in Organisms / Lists & Tables / DataList
  3. Invoke /gamut-datatable or /gamut-datalist in a Claude Code session — verify the skills surface and contain accurate prop tables and examples
  4. Invoke /gamut-list — verify the "reach for a higher-level component first" callout appears at the top of "When to use List"
  5. Invoke /gamut-buttons — verify the ToolTip focus section is a 3-line pointer to TOOLTIP_FOCUS.md, and that TOOLTIP_FOCUS.md contains the full pattern
  6. Invoke /gamut-review on a repo with SCSS imports — verify Checks 3b and 3c appear in the output
  7. Run yarn sync-skills from the repo root — verify it outputs synced: gamut-create-skill and that .claude/skills/gamut-create-skill/SKILL.md and .cursor/rules/gamut-create-skill.mdc are up to date
  8. Run node scripts/sync-local-skills.mjs --check — verify it exits 0 with "All generated skill files are up to date"
  9. Run yarn test:bin (or nx run @codecademy/gamut:test-bin) — all 6 installDesignMd tests should pass
  10. Run gamut plugin install --theme core in a fresh directory — verify DESIGN.md is created with a <!-- Generated by @codecademy/gamut@x.y.z --> header
  11. Run the same command again without --force — verify it errors with "already exists"
  12. Run with --force — verify it overwrites cleanly

PR Links and Envs

Repository PR Link
Monolith N/A
Mono N/A

@nx-cloud

nx-cloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit cca5497


☁️ Nx Cloud last updated this comment at 2026-06-18 15:25:04 UTC

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.89%. Comparing base (880fb1e) to head (cca5497).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3369      +/-   ##
==========================================
- Coverage   90.38%   89.89%   -0.50%     
==========================================
  Files         398      270     -128     
  Lines        6576     5660     -916     
  Branches     2132     1909     -223     
==========================================
- Hits         5944     5088     -856     
+ Misses        624      564      -60     
  Partials        8        8              
Flag Coverage Δ
main ?
pull-request 89.89% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dreamwasp dreamwasp changed the title add tests skills improvements Jun 17, 2026
@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 72.0.3-alpha.67eeac.0 npm diff
@codecademy/gamut-icons 9.57.10-alpha.67eeac.0 npm diff
@codecademy/gamut-illustrations 0.58.16-alpha.67eeac.0 npm diff
@codecademy/gamut-kit 3.0.3-alpha.67eeac.0 npm diff
@codecademy/gamut-patterns 0.10.35-alpha.67eeac.0 npm diff
@codecademy/gamut-styles 20.0.3-alpha.67eeac.0 npm diff
@codecademy/gamut-tests 6.0.6-alpha.67eeac.0 npm diff
@codecademy/variance 0.26.2-alpha.67eeac.0 npm diff
eslint-plugin-gamut 2.4.4-alpha.67eeac.0 npm diff

@github-actions

Copy link
Copy Markdown
Contributor

@dreamwasp dreamwasp changed the title skills improvements feat(ai-tools): skills improvements + contributor skill tooling Jun 18, 2026
@dreamwasp dreamwasp marked this pull request as ready for review June 18, 2026 17:00
@dreamwasp dreamwasp requested a review from a team as a code owner June 18, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the Gamut agent-tools ecosystem by adding new DataTable/DataList skills, improving existing skills and Storybook surfacing, introducing contributor-only skill syncing to Claude/Cursor, and enhancing DESIGN.md installation to be self-documenting with tests.

Changes:

  • Added new gamut-datatable and gamut-datalist skills and updated multiple existing skills for clearer triggers, cross-links, and guidance.
  • Introduced local-skills/ as the contributor-only skill source of truth plus a sync script and pre-commit automation to generate .claude/skills/ and .cursor/rules/ outputs.
  • Updated installDesignMd to stamp a generated header (with version + rerun command) and added Node test-runner coverage wired into Nx.

Reviewed changes

Copilot reviewed 38 out of 40 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/sync-local-skills.mjs New sync/check script to generate Claude/Cursor skill files from local-skills/.
packages/styleguide/src/lib/Typography/Text/Text.mdx Adds Storybook callout pointing to /gamut-typography.
packages/styleguide/src/lib/Organisms/Lists & Tables/List/List.mdx Adds Storybook callout pointing to /gamut-list.
packages/styleguide/src/lib/Organisms/Lists & Tables/DataTable/DataTable.mdx Adds Storybook callout pointing to /gamut-datatable.
packages/styleguide/src/lib/Organisms/Lists & Tables/DataList/DataList.mdx Adds Storybook callout pointing to /gamut-datalist.
packages/styleguide/src/lib/Organisms/GridForm/About.mdx Adds Storybook callout pointing to /gamut-forms.
packages/styleguide/src/lib/Meta/AI Tooling/Gamut plugin/Best practices.mdx Splits “Agent skills” into exported vs contributor-only; adds new skill entries.
packages/styleguide/src/lib/Foundations/ColorMode/ColorMode.mdx Adds Storybook callout pointing to /gamut-color-mode.
packages/styleguide/src/lib/Atoms/Buttons/TextButton/TextButton.mdx Adds Storybook callout pointing to /gamut-buttons.
packages/styleguide/src/lib/Atoms/Buttons/StrokeButton/StrokeButton.mdx Adds Storybook callout pointing to /gamut-buttons.
packages/styleguide/src/lib/Atoms/Buttons/IconButton/IconButton.mdx Adds Storybook callout pointing to /gamut-buttons.
packages/styleguide/src/lib/Atoms/Buttons/FillButton/FillButton.mdx Adds Storybook callout pointing to /gamut-buttons.
packages/styleguide/src/lib/Atoms/Buttons/CTAButton/CTAButton.mdx Adds Storybook callout pointing to /gamut-buttons.
packages/gamut/project.json Adds test-bin target and wires it into test via dependsOn.
packages/gamut/package.json Adds test:bin script for Node test runner.
packages/gamut/bin/lib/design.mjs Updates DESIGN.md installer to prepend a generated header (version + rerun command).
packages/gamut/bin/tests/design.test.mjs Adds Node test-runner coverage for installDesignMd.
packages/gamut/agent-tools/skills/gamut-typography/SKILL.md Refines skill description scope and cross-reference.
packages/gamut/agent-tools/skills/gamut-theming/SKILL.md Removes “Key principles” sediment section.
packages/gamut/agent-tools/skills/gamut-testing/SKILL.md Fixes frontmatter formatting artifact.
packages/gamut/agent-tools/skills/gamut-system-props/SKILL.md Updates description and fixes Best Practices link to Storybook URL.
packages/gamut/agent-tools/skills/gamut-style-utilities/SKILL.md Fixes Best Practices link and removes “Key principles” sediment.
packages/gamut/agent-tools/skills/gamut-review/SKILL.md Expands audit checks (SCSS/className, nested selectors, CSS vars, etc.) and remediation links.
packages/gamut/agent-tools/skills/gamut-list/SKILL.md Adds DataTable/DataList cross-references and “reach higher-level component first” guidance.
packages/gamut/agent-tools/skills/gamut-layout/SKILL.md Expands description to better surface responsive/layout triggers.
packages/gamut/agent-tools/skills/gamut-forms/SKILL.md Normalizes description to “Use this skill when…” trigger framing.
packages/gamut/agent-tools/skills/gamut-datatable/SKILL.md New skill documenting DataTable usage, props, ColumnConfig patterns, and examples.
packages/gamut/agent-tools/skills/gamut-datalist/SKILL.md New skill documenting DataList usage, expansion/selection patterns, and examples.
packages/gamut/agent-tools/skills/gamut-color-mode/SKILL.md Streamlines semantic alias documentation and links to canonical Storybook sources.
packages/gamut/agent-tools/skills/gamut-buttons/TOOLTIP_FOCUS.md New focused doc for ToolTip lingering/focus management pattern.
packages/gamut/agent-tools/skills/gamut-buttons/SKILL.md Replaces long inline section with pointer to TOOLTIP_FOCUS.md.
packages/gamut/agent-tools/skills/gamut-accessibility/SKILL.md Refines description trigger framing.
packages/gamut/agent-tools/.cursor-plugin/plugin.json Bumps plugin version.
packages/gamut/agent-tools/.claude-plugin/plugin.json Bumps plugin version.
package.json Adds sync-skills and sync-skills:watch scripts.
local-skills/gamut-create-skill/SKILL.md Adds contributor-only “create skill” blueprint skill.
.nx/version-plans/version-plan-1780940298971.md Adds version plan for a minor bump.
.husky/pre-commit Runs sync-local-skills and stages generated outputs.
.cursor/rules/gamut-create-skill.mdc Generated Cursor rule output for gamut-create-skill.
.claude/skills/gamut-create-skill/SKILL.md Generated Claude skill output for gamut-create-skill.

Comment on lines +45 to +52
// Orphans: directories in .claude/skills/ with no matching local-skills/ source
const claudeEntries = await readdir(CLAUDE_SKILLS_DIR, {
withFileTypes: true,
}).catch(() => []);
const orphans = claudeEntries
.filter((e) => e.isDirectory() && !activeNames.has(e.name))
.map((e) => e.name);

Comment on lines +100 to +106
const claudeDest = join(CLAUDE_SKILLS_DIR, name, 'SKILL.md');
const cursorDest = join(CURSOR_RULES_DIR, `${name}.mdc`);
await mkdir(dirname(claudeDest), { recursive: true });
await Promise.all([
writeFile(claudeDest, content, 'utf8'),
writeFile(cursorDest, content, 'utf8'),
]);
Comment on lines +75 to +78
| `header` | `string` | Column header label |
| `type` | `'header' \| 'control'` | `'header'` makes the column sticky when scrollable; `'control'` right-aligns and removes padding for action buttons |
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | Column width; omit to fit content |
| `fill` | `boolean` | Expands the column to fill remaining width |
Comment on lines +74 to +77
| `key` | `keyof Row` | Required; maps to a row data field |
| `header` | `string` | Column header label |
| `type` | `'header' \| 'control'` | `'header'` makes the column sticky when scrollable; `'control'` right-aligns and removes padding for action buttons |
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | Column width; omit to fit content |
Comment on lines +257 to +265
<div style={{ width: '280px' }}>
<DataList
disableContainerQuery
id="sidebar-list"
idKey="id"
rows={data}
columns={columns}
/>
</div>
SKILL.md ← canonical source
```

Contributor skills are synced automatically to `.claude/skills/` (Claude Code) and `.cursor/rules/` (Cursor) by the pre-commit hook. To sync manually: `yarn sync-skills`. To watch during development: `yarn sync-skills:watch`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why rules for cursor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch - claude i CONVINCED cursor can't use skills. i'll fix

@LinKCoding LinKCoding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the guidance --

I didn't check against all the technical writing, but looked after the styling and overall layout and it LGTM!

I have some thoughts on consistency for how files are linked to. And some Callout text could be updated to style the "code".

🔥 🔥🔥

Full tables: Storybook theme pages or audit with [`gamut-review`](../gamut-review/SKILL.md) Appendix A/B for hex triage.
## Semantic aliases

These tokens describe roles; actual colors come from the active theme + ColorMode. Full alias tables: [Foundations / ColorMode](https://gamut.codecademy.com/?path=/docs-foundations-colormode--page) — and per-theme breakdowns at [Core](https://gamut.codecademy.com/?path=/docs-foundations-theme-core-theme--docs) · [Admin](https://gamut.codecademy.com/?path=/docs-foundations-theme-admin-theme--docs) · [Platform](https://gamut.codecademy.com/?path=/docs-foundations-theme-platform-theme--docs) · [Percipio](https://gamut.codecademy.com/?path=/docs-foundations-theme-percipio-theme--docs) · [LX Studio](https://gamut.codecademy.com/?path=/docs-foundations-theme-lx-studio-theme--docs). Source: [`packages/gamut-styles/src/themes`](https://github.com/Codecademy/gamut/tree/main/packages/gamut-styles/src/themes).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than link to the sites, would it be ok to link to the local markdown files?


Item-focused list for managing, engaging with, and expanding individual rows. Use when users interact with items — opening details, selecting for bulk actions, or viewing expanded layouts — rather than scanning and comparing data across rows.

Source: `@codecademy/gamut` — [DataList.tsx](https://github.com/Codecademy/gamut/blob/main/packages/gamut/src/DataList/DataList.tsx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note here about linking to the local file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll stop leaving notes re: path
maybe something the robot can just audit

---
name: gamut-system-props
description: Use this skill when building or refactoring styled Gamut components that need layout, spacing, color, border, background, typography, positioning, grid, flex, shadow, list styles, or responsive values from @codecademy/gamut-stylesincluding composing system prop groups with variance.
description: 'Use this skill when composing system prop groups (`system.*`) on styled components, selecting which group covers a CSS property, or building responsive props with `variance.compose()`not for `css()`, `variant()`, or `states()` (see gamut-style-utilities).'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the other descriptions aren't wrapped in quotes


<ComponentHeader {...parameters} />

<Callout text="Use the /gamut-buttons skill in Cursor or Claude Code for AI-assisted guidance on button selection, variants, disabled patterns, and ToolTip focus management." />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Callout text="Use the /gamut-buttons skill in Cursor or Claude Code for AI-assisted guidance on button selection, variants, disabled patterns, and ToolTip focus management." />
<Callout
text={
<>
Use the <code>/gamut-buttons<code> skill in Cursor or Claude Code for AI-assisted guidance on button selection, variants, disabled patterns, and ToolTip focus management."
</>
}
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally a stylistic thing, but feels cleaner


**Storybook MDX**

Read the component's MDX documentation page:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving this as a reference -- there's a few instances where the agent is being prompted to fetch from the SB site instead of a local file.

I'd assume reading locally is faster

@@ -0,0 +1,263 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, are these files automatically sync'd + duped?
or are these manual?
In Front, when I did the a11y skill, I saw the files being automatically duped into a .claude folder (see: https://github.skillsoft.com/federated-front/front/pull/13922/files)
I'm guessing the .claude folder was gitignored too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants